<template>
  <view>
    <navBar ref='navRef' :navbarData.sync="navbarData"></navBar>
    <loading :showLoaded.sync="showLoaded"></loading>
    <block v-if="isMember">
      <view class="share_box">
        <view class="share_title">好友心愿单</view>
        <view class="share_item" v-for="(item, index) in goodsList" :key="index">
          <image class="main_img" :src="item.img" @click="skipPdp(item)"></image>
          <view class="list-right">
            <view class="name" :style="{color: item.approveStatus == 'onsale' && item.qty > 0 ? '#000':'#757575'}">{{item.itemName}}</view>
            <view class="frontName">{{item.valueName}}</view>
            <view class="price_box">
              <view class="price" :style="{color: item.approveStatus == 'onsale' && item.qty > 0 ? '#000':'#757575'}">
                <text class="mark">¥</text>
                <text>{{filterChecked.moneyFormat(item.price, 2)}}</text>
                <text class="price_tex" v-if="item.approveStatus != 'onsale'">已下架</text>
                <text class="price_tex" v-if="item.approveStatus == 'onsale' && item.qty <= 0">已售罄</text>
              </view>
              <view class="btn_area">
                <view class="cart_icon" @click='handleAddCart(item)' v-if="!item.isSpecial && item.approveStatus == 'onsale' && item.qty > 0">
                  <image src="https://100000063-1252208446.file.myqcloud.com/images/macallan-remvp/cart_active.png"></image>
                </view>
                <view class="cart_icon" style="margin-left: 12rpx;" @click="handleMyWish(item)">
                  <image v-if="item.isMyWish" src="https://100000063-1252208446.file.myqcloud.com/images/macallan-remvp/pdp/Saved.png"></image>
                  <image v-else src="https://100000063-1252208446.file.myqcloud.com/images/macallan-remvp/pdp/Save.png"></image>
                </view>
              </view>
            </view>
          </view>
        </view>
        <view class="my_wishbox">
          <view class="my_wishbtn" @click="handleToMyWish">我的心愿单</view>
        </view>
      </view>
      <cart-toast v-if="showCartMsg" :cartMessage='cartMessage' :cartStatus='cartStatus' bottom="158rpx"></cart-toast>
    </block>
    <register-widget ref="registerWidgetRef" location="wishListShare" @finish="onRegisterWidgetFinish" :tsActId="tsActId"
    	@registerSuccess='registerSuccess' />
		<!-- 弱提示 弹窗 -->
		<toast-popup ref="toastPopup" @onToastPopupClick="onToastPopupClick"></toast-popup>
  </view>
</template>
<script module="filterChecked" lang="wxs" src="@/utils/filter.wxs"></script>
<script>
  import navBar from '@/components/common/navbar';
  import Loading from '@/components/common/loading';
	import api from '@/api/api';
  import { CUSTOMER_INFO, MERCHANT_INFO, USER_SPECICAL_INFO } from '@/utils/constant';
  import CartToast from '@/components/common/cartToast.vue';
  import registerWidget from "@/components/register/register-widget.vue";
  import {
  	getSubscribeStatus,
  	getActivitySubscribeTemplate,
  	doSubscribe,
  	setFav,
  } from '@/utils/commonActItems.js'
	import util from '@/utils/util.js';
  export default {
    name: 'wishListShare',
    components: {
      navBar,
      Loading,
      CartToast,
      registerWidget
    },
    data() {
      return {
        navbarData: {
          showCapsule: 1,
          navbarTitle: '' //导航栏 中间的标题
        },
        showLoaded: false,
        goodsList: [],
        cartMessage:'',       //  加入购物车提示语
        showCartMsg:false,
        cartStatus: false,    //  加入购物车是否成功
        myWishLists: [],
        isMember: false,
        shareId: null,
        queryOption: null,
        wishList:[],
				tsApplySkuCodes: [],
				preStartTime: null,
				startTime: null,
				endTime: null,
				nowTime: null
      }
    },
    mounted() {
      uni.hideShareMenu();
    },
    async onLoad(option) {
      this.queryOption = option;
      this.shareId = option.id || "";
    },
    async onShow() {
      try{
        this.showLoaded = true;
        if (this.queryOption && this.queryOption.scene) {
        	await this.getScence(this.queryOption.scene)
        }
				await this.handleGetUserTsData();
				await this.getServerTime();
        await this.memberCheck();
        if(this.shareId){
          this.getShareInfoById(this.shareId);
        }
      }catch(e){}
    },
    methods: {
			/**
			 * 展示弱提示
			 * @param {Object} msg 文案
			 */
			handleShowTextToast(msg){
				try{
					this.$refs.toastPopup.showToast(msg);
				}catch(e){}
			},
			/**
			 * 若提示按钮点击回调
			 * @param {Object} data.type 类型：confirm确定，cancel取消
			 * @param {Object} data.callBackData 呼气弹窗时传入的数据
			 */
			onToastPopupClick(data){},
			//	获取服务器时间
			async getServerTime(){
				this.nowTime = new Date().getTime();
				try{
					const json = await api.getServerTime({
						method: "POST",
						query: {},
					});
					if (json.code === 1000 && json.data) {
						let time = JSON.parse(json.data);
						this.nowTime = time.server_date;
					}
				}catch(e){}
			},
      // 获取自定义参数
      async getScence(key) {
      	const sence = await api.getScence({
      			method: 'GET',
      		},
      		key,
      	)
      	if (sence.code === 1000) {
      		let value = JSON.parse(sence.data.value)
      		this.shareId = value.id;
      	}
      },
      async memberCheck(){
        this.$commonFunction.commonLoginNew().then((res)=> {
          let customerInfo = res.data;
          //  查询会员信息
          if(!this.isMember){
            this.getMemberDetail(customerInfo.jwt);
          }else{
            this.showLoaded = false;
          }
        }).catch(err => {

          this.showLoaded = false;
        });
        return true;
      },
      /**
       * 判断是否是会员
       *
       * @param jwt
       * @return {Promise<void>}
       */
      async getMemberDetail(jwt) {
        let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
        const memberRes = await api.getMemberDetails({
          header: {
            jwt: customerInfo.jwt || jwt
          }
        });
        if (memberRes.code == 1000 && memberRes.data && memberRes.data.memberId) {
          const phoneNumberReg = /^1\d{10}$/;
          if(!phoneNumberReg.test(memberRes.data.mobile)){
            // 非大陆手机号按照非会员对待,重新入会
            uni.removeStorageSync('memberDetails');
            this.isMember = false;
            return;
          }
          this.isMember = true;
        }else{
          this.isMember = false;
        }
        this.showLoaded = false;
      },
      //  根据分享id查询分享数据
      async getShareInfoById(shareId){
        const resData = await api.getShareInfoById({
        	method: 'GET',
        	shareId
        });
        if(resData && resData.success && resData.data && resData.data.value){
          const _goodsLists = JSON.parse(resData.data.value);
          let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
          let merchantInfo = uni.getStorageSync(MERCHANT_INFO);
          let _itemCodeArr = [];
          for(let i=0;i<_goodsLists.length;i++){
            _goodsLists[i].qty = 0;
            _goodsLists[i].isSpecial = false;
            _goodsLists[i] = await this.getDetailsById(customerInfo, merchantInfo, _goodsLists[i]);
            //  暂存itemCode 用于调用批量查询实时库存接口
            if(_goodsLists[i].skuCode) _itemCodeArr.push(_goodsLists[i].skuCode);
          }

          //  查询浏览商品实时库存
          const _availableQty = await this.getAvailableBatchQty(customerInfo, merchantInfo, _itemCodeArr);
          if(_availableQty && _availableQty.length){
            _goodsLists.forEach(item=>{
              if(item.approveStatus == "onsale"){
                _availableQty.forEach(el=>{
                  if(item.skuCode == el.skuCode) item.qty = el.availableQty < 1 ? 0 : el.availableQty;
                })
              }
            })
          }
          this.goodsList = await this.dealGoodsIsWish(_goodsLists, customerInfo, merchantInfo);
        }
      },
      /**
       * 商品 是否收藏心愿单状态修改
       * @param {Object} _goodsLists  商品列表
       * @param {Object} customerInfo
       * @param {Object} merchantInfo
       */
      async dealGoodsIsWish(_goodsLists, customerInfo, merchantInfo){
        try{
          const _lists = JSON.parse(JSON.stringify(_goodsLists));
          _lists.forEach(el=>{
            el.isMyWish = false;
          })
          //  判断当前是否已收藏
          const _myWishLists = await this.getUserWishLists(customerInfo, merchantInfo);
          if(_myWishLists.length){
            _lists.forEach(item=>{
              _myWishLists.forEach(el=>{
                if(item.itemId == el.extendedField1 && item.valueId == el.extendedField2){
                  item.isMyWish = true;
                }
              })
            })
          }
          return _lists;
        }catch(e){
          return _goodsLists;
        }
      },
      /**
       * 商品数组组装
       * @param {Object} customerInfo
       * @param {Object} merchantInfo
       * @param {Object} itemObj
       */
      async getDetailsById(customerInfo, merchantInfo, itemObj){
        return new Promise(async (resolve, reject)=>{
          try{
            const itemId = itemObj.itemId;
            const valueId = itemObj.valueId;
            //  查询商品详情
            const _goodsData = await api.goodsDetail({
                query: {
                  merchant_id: merchantInfo.cloudMerchantId,
                  store_id: merchantInfo.cloudMerchantStoreId
                }
              },
              itemId
            );
            if(_goodsData && _goodsData.code == 1000 && _goodsData.data){
              const _tagdata = _goodsData.data;
              const _price = _tagdata?.skus.length ? _tagdata?.skus[0].price : 0;
              const _markingPrice = _tagdata?.skus.length ? _tagdata?.skus[0].markingPrice : 0;
              itemObj.itemData = _tagdata;
              itemObj.skuCode = (_tagdata?.skus && _tagdata?.skus[0] && _tagdata?.skus[0]?.skuCode) ? _tagdata.skus[0].skuCode : "";
              itemObj.qty = _tagdata?.qty || 0;
              itemObj.img = "";
              //  查询商品高清大图
              const _hdlpObj = _tagdata.resources.find((item)=>item.kind == "hdlp");
              if(_hdlpObj && _hdlpObj.kind == "hdlp" && _hdlpObj.type == "image" && _hdlpObj.url) itemObj.img = _hdlpObj.url;

              itemObj.valueName = "";
              itemObj.itemName = _tagdata?.itemName || "";
              itemObj.qty = _tagdata?.qty || 0;
              itemObj.price = _price <= 0 ? Number(_markingPrice) : Number(_price);
              if(_tagdata.itemCustomParameters){
                const _resData = JSON.parse(_tagdata.itemCustomParameters);
                if(_resData.isLuckyDrawItem) itemObj.isSpecial = true;
              }

              //  判断商品是否参加活动
              let jsonData = await api.getDrawInfo({
                method: 'GET',
                query: {
                  store_id: merchantInfo.cloudMerchantStoreId,
                  merchant_id: merchantInfo.cloudMerchantId,
                  customer_id: customerInfo ? customerInfo.customerId : '',
                  item_id: itemId,
                  value_id: valueId
                }
              });
              if(jsonData && jsonData.code === 1000 && jsonData.data) itemObj.isSpecial = true;

              _tagdata.frontProperties.forEach(item=>{
                if(item.valueId == valueId){
                  itemObj.valueName = item.valueName;
                  if(!itemObj.img) itemObj.img = item.hoverUrl
                }
                if(!itemObj.itemName && item?.subtitle) itemObj.itemName = item.subtitle;
                if(item.frontCustomParameters){
                  const _frontCustomParameters = JSON.parse(item.frontCustomParameters);
                  //特殊购买自定义参数为1时是特殊购买商品isSpecial为true
                  if (_frontCustomParameters['privateSaleMark'] == 1){
										if(this.tsApplySkuCodes.includes(itemObj.skuCode) && this.startTime && this.endTime && this.nowTime > this.startTime && this.nowTime < this.endTime){
											itemObj.isSpecial = false;
										}else{
											itemObj.isSpecial = true;
										}
									};
                  //意向登记
                  if (_frontCustomParameters['intentCheckMark'] == 1) itemObj.isSpecial = true;
                }
                itemObj.approveStatus = item.approveStatus;
              });
            }
            resolve(itemObj)
          }catch(e){
            resolve(itemObj)
          }
        })
      },
      /**
       *  价格策略
       */
      async getPriceRules(itemObj) {
        try{
          let that = this;
          return new Promise(async (resolve, reject) => {
            let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
            let memberDetails = uni.getStorageSync('memberDetails') || getApp().globalData.memberDetails;
            if (!itemObj.valueId) resolve(itemObj);
            const json = await api.getPriceRules({
                query: {
                  group_id: customerInfo.groupId || 0,
                  member_level_id: memberDetails.memberLevelId || 0,
                  member_status: memberDetails.isActive || 'Inactive'
                }
              },
              uni.getStorageSync(MERCHANT_INFO).cloudMerchantId,
              itemObj.itemId,
              itemObj.valueId
            );
            if (json?.code === 1000 && json?.data.length) {
              const res = await that.$commonFunction.priceRulesDeal(json.data, itemObj.itemCode);
              if (res.price !== 0 && itemObj.itemCode == res.itemCode) itemObj.price = res.price
              if (res.rulesArr.length > 0) itemObj.rulesArr = res.rulesArr;
            }
            resolve(itemObj);
          })
        }catch(e){
          resolve(itemObj);
        }
      },
      /**
       *  查询实时库存
       */
      async getAvailableBatchQty(customerInfo, merchantInfo, itemCodeArr){
        if(!itemCodeArr || !itemCodeArr.length) return [];
        const res = await api.getAvailableBatchQty({
          method: "POST",
          header: {
            jwt: customerInfo.jwt,
            'content-type': 'application/json'
          },
          query: itemCodeArr
        }, merchantInfo.cloudMerchantId);
        if(res && res.code === 1000) return res?.data || [];
        return [];
      },
      /**
       * 商品加入购物车功能
       * @param {Object} item
       */
      async handleAddCart(item) {
        if(item.isSpecial) return;
        if(item.itemData && item.approveStatus == "onsale"){
          if(item.qty>0){
            const cartRes = await this.$commonFunction.buildProductsAddCart({
              price: item.itemData.skus[0].price,
			  itemId: item.itemData.itemId,
              valueId: item.itemData.frontProperties[0].valueId,
              itemCode: item.itemData.itemId,
              itemName: item.itemData.itemName,
              qty: 1,
              skuCode: item.itemData.skus[0].skuCode,
              skuId: item.itemData.skus[0].skuId
            });
            this.handleCartToast(cartRes);
            this.buildSrDataTrack(item,"addCartClick");
          }else if(item.qty <= 0){
            this.arrivalNowSubscribe(item.itemData);
          }
        }else{
          if(item.approveStatus != "onsale"){
            this.queryArrivalResult();
          }
        }
      },
      /**
       * 加购提示
       * @param {Object} obj
       */
      async handleCartToast(obj){
				const _arr = ['您动作太快，请慢点哟～', '网络状态不佳，请重试'];
				if(obj.msg && _arr.includes(obj.msg)){
					this.handleShowTextToast(obj.msg)
				}else if(obj.data && obj.data.msg && obj.data.type === 'showToast'){
					this.handleShowTextToast(obj.data.msg)
				}else{
					// if(obj?.success) this.getCartItems();
					this.cartMessage = obj?.msg || "加入购物袋失败";
					this.cartStatus = obj?.success || false;
					this.showCartMsg = true;
					setTimeout(()=>{
						this.showCartMsg = false;
					},3000);
				}
      },
      /**
       * 有数埋点数据组装
       * @param {Object} item
       * @param {Object} type
       */
      async buildSrDataTrack(item, type){
        const _itemData = item.itemData || null;
        if(_itemData){
          const _srParams = {
            skuCodes: [_itemData.itemCode || ""],
            itemName: _itemData.itemName || "",
            outerItemId: _itemData.outerItemId || "",
            frontProperties: _itemData.frontProperties || [],
            itemCode: _itemData.itemCode || "",
            categoryId:  _itemData.categoryId || "",
            skuImageUrl:  _itemData.frontProperties[0].skuImageUrl || ""
          }
          this.$commonUtoolsTrack.tencentYoushuTracking(_srParams, type);
        }
      },
      //  跳转pdp页面
      skipPdp(item) {
        uni.navigateTo({
          url: `/pages/item/item?id=${item.itemId}&valueId=${item.valueId}`
        })
      },
      //  查询用户心愿单列表
      async getUserWishLists(customerInfo, merchantInfo) {
        try {
          const query = {
            store_id: merchantInfo.cloudMerchantStoreId,
            type: 0, // 0心愿单 1意向登记
            page_no: 1,
            page_size: 200
          };
          const res = await api.getWishList({
            method: "GET",
            header: {
              jwt: customerInfo.jwt,
            },
            query
          })
          if (res.code == 1000) {
            const _lists = await this.getOrderItemHDImg(res.data.content, merchantInfo, customerInfo)
            this.wishList = _lists;
          }
          //  神策埋点 心愿单浏览
          this.trackWishListView();
          return (res.code == 1000 && res?.data?.content) ? res.data.content : [];
        } catch (err) {
          return [];
        }
      },

      /**
       * 查询订单商品的高清大图
       * @param {Object} lists
       * @param {Object} merchantInfo
       */
       async getOrderItemHDImg(lists, merchantInfo, customerInfo){
        const that = this;
        let _lists = JSON.parse(JSON.stringify(lists));
        _lists.forEach(item=>{
			item.itemId = item.extendedField1;
			item.valueId = item.extendedField2;
          item.qty = 0;
          item.isSpecial = false;
        })
        if(_lists && _lists.length){
          let _itemCodeArr = [];
          for (let i = 0; i < _lists.length; i++) {
            _lists[i] = await that.getDetailsById(customerInfo,merchantInfo,_lists[i]);
            //  暂存itemCode 用于调用批量查询实时库存接口
            if(_lists[i].skuCode) _itemCodeArr.push(_lists[i].skuCode);
          }
          //  查询浏览商品实时库存
          const _availableQty = await that.getAvailableBatchQty(customerInfo, merchantInfo, _itemCodeArr);
          if(_availableQty && _availableQty.length){
            _lists.forEach(item=>{
              if(item.approveStatus == "onsale"){
                _availableQty.forEach(el=>{
                  if(item.skuCode == el.skuCode) item.qty = el.availableQty < 1 ? 0 : el.availableQty;
                })
              }
            })
          }
        }
        return _lists;
      },

      // 神策埋点  心愿单浏览
      async trackWishListView(){
        let spuList = [];
        let skuList = [];
        let nameList = [];
        let productQuantity = 0;
        this.wishList.forEach(function(item, index, array) {
          productQuantity += 1;
          nameList.push(item.referenceName)
          skuList.push(item.extendedField2)
          spuList.push(item.extendedField1)
        });
        let _obj = {
          page_name:"好友心愿单",
          product_quantity: productQuantity,
          product_sku_quantity: productQuantity,
          product_spu_list: spuList,
          product_sku_list: skuList,
          product_name_list: nameList,
        };
        this.$commonSensors.lithaTrack.cTrack('WishListView',_obj);
      },
      //  添加/删除心愿单
      async handleMyWish(item){
        let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
        let merchantInfo = uni.getStorageSync(MERCHANT_INFO);
        uni.showLoading();
        if(item.isMyWish){
          //删除
          await setFav(item.itemData, 'cancel', '', 0)
        }else{
          //  添加
          await setFav(item.itemData, 'add', item.valueId, 0);
          this.handleCartToast({success: true, msg: "已添加至我的心愿单"})
        }
        this.goodsList = await this.dealGoodsIsWish(this.goodsList, customerInfo, merchantInfo);
        uni.hideLoading();
      },
      //  跳转我的心愿单
      handleToMyWish(){
        const params={
          page_name:'好友心愿单',
          button_name:'我的心愿单'
        }
        this.$commonSensors.paramsTrack('WishListClick',params)
        uni.navigateTo({
          url: `/pages/customer/wishList`
        })
      },
      registerSuccess: async function() {
      	let that = this
      	// that.showRegister = 1
      },
      /** 18岁弹窗确认 */
      async onRegisterWidgetFinish(e) {
        let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
        if(customerInfo && customerInfo.jwt && !this.isMember){
          return this.getMemberDetail(customerInfo.jwt);
        }

        if(!this.isMember){
          await this.memberCheck();
        }

        if(e.componentName == 'age-confirm-modal' && !this.isMember){
          return this.$refs.registerWidgetRef.openJoinMemberModal();
        }

      },
      //  到货提醒订阅通知
      async arrivalNowSubscribe(item) {
      	let that = this
      	let templateId = ['4SfLNnxKf26rpT4GO9w4PrrPzlFR40NBjZdOnXHNq8k'];
      	uni.requestSubscribeMessage({
      		tmplIds: templateId,
      		success(res) {
      			if (res['4SfLNnxKf26rpT4GO9w4PrrPzlFR40NBjZdOnXHNq8k'] == "accept") {
      				that.arrivalNow(item);
      			}
      		},
      		fail(res) {},
      		complete(res) {

      		}
      	});
      },
      async arrivalNow(itemData) {
        const {itemId, frontProperties, itemName, itemCode, skus} = itemData;
      	let that = this;
      	let userSpecialInfo = uni.getStorageSync(USER_SPECICAL_INFO);
      	const accountInfo = uni.getAccountInfoSync();
      	let merchantInfo = uni.getStorageSync('merchantInfo');
      	let customerInfo = uni.getStorageSync(CUSTOMER_INFO) || getApp().globalData.customerInfo;
        const _colorName = frontProperties[0]?.valueName || "";
        const _valueId = frontProperties[0]?.valueId || "";
        if (!_valueId) return;
      	let page = `/pages/item/item?id=${itemId}&valueId=${_valueId}&valueName=${_colorName}`
      	if (customerInfo) {
      		let res = await api.arrivalRemind({
      			method: 'POST',
      			header: {
      				jwt: customerInfo.jwt,
      				appId: accountInfo.miniProgram.appId
      			},
      			query: {
      				frontCode: skus[0]?.skuProperties[0]?.frontCode,
      				frontUrl: page,
      				itemCode: itemCode,
      				itemId: itemId,
      				itemName: frontProperties[0]?.subtitle.split(',').join('') || itemName,
      				mobile: customerInfo.mobile,
      				nickName: customerInfo.nickName,
      				openId: customerInfo.openId,
      				skuCode: skus[0]?.skuCode,
      				storeId: merchantInfo.cloudMerchantStoreId,
      				unionId: customerInfo.unionId || 'unionId',
      				valueId: _valueId,
      				valueName: _colorName
      			},
      		});
      		if (res.code == 1000 || res.code == 200 || res.code == -1003) {
      			this.handleCartToast({success: true, msg:"该商品已售罄，已为您订阅到货提醒"})
      			return true
      		} else {
      			this.handleCartToast({success: false, msg:"到货提醒订阅失败"})
      			return false
      		}
      	}
      },
      //  商品上新通知
      async queryArrivalResult(){
        const that = this;
        const _id = api.environment == 'trial' ? 138 : 218;
        let subscribeStatus = await getSubscribeStatus(_id);
        if (!subscribeStatus) {
          let {
            templateId,
            activitySubscribeName
          } = await getActivitySubscribeTemplate(_id);
          const template = new Array(templateId);
          uni.requestSubscribeMessage({
          	tmplIds: template,
          	success(res) {
          		if (res[template[0]] == "accept") {
          			// 用户允许接收订阅消息
          			doSubscribe(_id).then((res) => {
          				that.handleCartToast({success: true, msg:"该商品已下架，已为您订阅上新通知"});
          			}).catch(e=>{
                  that.handleCartToast({success: false, msg:"上新通知订阅失败"})
                })
          		}
          	},
          	fail(res) {},
          	complete(res) {}
          });
        } else {
          this.handleCartToast({success: true, msg:"该商品已下架，已为您订阅上新通知"});
        }
      },
			//  查询用户ts活动信息
			async handleGetUserTsData() {
				this.tsApplySkuCodes = [];
				this.preStartTime = null;
				this.startTime = null;
				this.endTime = null;
				let memberDetails = uni.getStorageSync("memberDetails");
				if(!memberDetails) return false;
				let customerInfo = uni.getStorageSync(CUSTOMER_INFO);
				let merchantInfo = uni.getStorageSync(MERCHANT_INFO);
				const result = await api.getTsByUser({
					header: {
						jwt: customerInfo.jwt,
					},
					method: "GET",
					query: {
						store_id: merchantInfo.cloudMerchantStoreId,
						group_id: customerInfo.groupId,
						member_level_id: memberDetails.memberLevelId,
					},
				});
				if (result.code == 1000 && result.data) {
					this.tsApplySkuCodes = result.data.applySkuCodes || [];
					this.preStartTime = util.formatTimeStamp(result.data.teaserStartTime)
					this.startTime = util.formatTimeStamp(result.data.campaignStartTime)
					this.endTime = util.formatTimeStamp(result.data.campaignEndTime)
				}
			},
    },
  }
</script>
<style lang="scss">
.share_box{
  width: 100%;
  padding: 0 48rpx 200rpx 48rpx;
  font-family: FrankNew-Regular,NotoSansSC-Regular;
  font-size: 24rpx;
}
.share_title{
  font-size: 36rpx;
  line-height: 52rpx;
  font-family: NotoSansSC-Medium;
  text-align: center;
  margin-top: 28rpx;
  padding-bottom: 16rpx;
}
.share_item{
  width: 100%;
  height: 288rpx;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: #fafafa;
  margin-top: 24rpx;
  .main_img {
    width: 216rpx;
    height: 288rpx;
  }
  .btn_area{
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  .cart_icon {
    width: 48rpx;
    height: 48rpx;
    display: flex;
    align-items: center;
    image{
      width: 100%;
      height: 100%;
    }
    .share-button {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 100%;
      opacity: 0
    }
    .share {
      width: 28rpx;
      height: 27rpx;
    }
  }

  .list-right {
    width: 406rpx;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    .name {
      color: #000;
      width: 100%;
      line-height: 48rpx;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      font-size: 28rpx;
      overflow: hidden;
      line-clamp: 2;
      -webkit-line-clamp: 2;
      text-overflow: ellipsis;
      white-space: normal;
    }
    .frontName {
      color: #757575;
      font-size: 24rpx;
      line-height: 40rpx;
      margin-top: 4rpx;
    }
    .price_box{
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 28rpx;
      width: 100%;
    }
    .price {
      color: #1A1A1A;
      line-height: 48rpx;
      font-size: 24rpx;
    }
    .mark{
      font-family: NotoSansSC-Regular;
      margin-right: 4rpx;
    }
  }
}
.price_tex{
  color: #757575;
  margin-left: 16rpx;
}
.my_wishbox{
  padding:16rpx 48rpx 64rpx 48rpx;
  background-color: #fff;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
}
.my_wishbtn{
  width: 100%;
  height:80rpx;
  line-height: 80rpx;
  background-color: #000;
  color: #fff;
  font-size: NotoSansSC-Medium;
  font-size: 28rpx;
  text-align: center;
  border-radius: 40rpx 16rpx 48rpx 40rpx;
}
</style>
